
#pragma once

#include <condition_variable>
#include <memory>
#include <mutex>
#include <thread>

class EventLoop;
class EventLoopThread {
private:
    // Producer:
    void EntryThread();

public:
    EventLoopThread();

    // Consumer:
    EventLoop* SelfEventLoop();

    ~EventLoopThread();

private:
    std::thread thread_;
    EventLoop* loop_;
    std::mutex mutex_;              // 互斥锁
    std::condition_variable cond_;  // 条件变量
};
